package com.hxkcloud.patient.aerotel.view;


import android.content.Intent;
import android.os.Bundle;
import android.os.Message;
import android.view.View;

import com.hxkcloud.patient.R;
import com.hxkcloud.patient.activitys.BaseActivity;
import com.hxkcloud.patient.aerotel.util.F;
import com.hxkcloud.patient.aerotel.view.photoview.PhotoView;
import com.hxkcloud.patient.utils.IL;
import com.hxkcloud.patient.utils.ImageOptionUtils;


/**
 * Created by zhangtaoshuai on 2017/1/23.
 */

public class ShowBigPhotoHasTop extends BaseActivity implements View.OnClickListener{

    public static final String PATH = "path";

    private PhotoView ecgPicture;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ecg_bigphoto_hastop);
        init();
    }

    @Override
    protected void updateByHandler(Message msg) {

    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void initData() {

    }

    void init() {
        Intent intent = getIntent();
        String url = intent.getStringExtra("url");
        String path = intent.getStringExtra(PATH);
        ecgPicture = (PhotoView) findViewById(R.id.ecgPicture);
        ecgPicture.enable();
        if (url != null) {
            IL.displayImage(ShowBigPhotoHasTop.this, url, ecgPicture);
            imageLoader.displayImage(url, ecgPicture, ImageOptionUtils.getInstance().getSimplePicOptions());
        }
        if (path != null) {
            ecgPicture.setImageBitmap(F.getFileBitmap(path));
        }
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.ecgPicture:
                finish();
                break;
        }
    }
}
